package com.rich.dmr.widget;
import java.math.BigDecimal;
public class ChannelModel {
    private int id;
	private String nameChannel;
    private int txChannel;
    private int rxChannel;
	private int colorCode;
	private int timeSlot;
	private int power;
    private int password;
    private int phone;
    private String zone;
	private int channelMode;


    public ChannelModel(int id, String nameChannel, int txChannel, int rxChannel, int colorCode, int timeSlot, int power, int password,  String zone, int channelMode) {
        this.id = id;
        this.nameChannel = nameChannel;
        this.txChannel = txChannel;
        this.rxChannel = rxChannel;
        this.colorCode = colorCode;
        this.timeSlot = timeSlot;
        this.power = power;
        this.password = password;
        this.phone = phone;
        this.zone = zone;
        this.channelMode = channelMode;
    }


    public ChannelModel(int id, String nameChannel, int txChannel, int rxChannel, int colorCode, int timeSlot, int power, int channelMode) {
        this.id = id;
        this.nameChannel = nameChannel;
        this.txChannel = txChannel;
        this.rxChannel = rxChannel;
		this.colorCode = colorCode;
		this.timeSlot = timeSlot;
		this.power = power;
		this.channelMode = channelMode;
    }
	
    public ChannelModel(String nameChannel, int txChannel, int rxChannel,int colorCode) {
        this.nameChannel = nameChannel;
        this.txChannel = txChannel;
        this.rxChannel = rxChannel;
		this.colorCode = colorCode;
    }

	public int getChannelMode() {
        return channelMode;
    }

    public void setChannelMode(int channelMode) {
        this.channelMode = channelMode;
    }
	
	public int getColorCode() {
        return colorCode;
    }

    public void setColorCode(int colorCode) {
        this.colorCode = colorCode;
    }

	public int getTimeSlot() {
        return timeSlot;
    }

    public void setTimeSlot(int timeSlot) {
        this.timeSlot = timeSlot;
    }

	
	public int getPower() {
        return power;
    }

    public void setPower(int power) {
        this.power = power;
    }
	
    public String getNameChannel() {
        return nameChannel;
    }

    public int getPassword() {
        return password;
    }

    public void setPassword(int password) {
        this.password = password;
    }

    public int getPhone() {
        return phone;
    }

    public void setPhone(int phone) {
        this.phone = phone;
    }

    public String getZone() {
        return zone;
    }

    public void setZone(String zone) {
        this.zone = zone;
    }


    public void setNameChannel(String nameChannel) {
        this.nameChannel = nameChannel;
    }

    public int getTxChannel() {
        return txChannel;
    }

    public void setTxChannel(int txChannel) {
        this.txChannel = txChannel;
    }

    public int getRxChannel() {
        return rxChannel;
    }

    public void setRxChannel(int rxChannel) {
        this.rxChannel = rxChannel;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }
	
    @Override
    public String toString() {
        return "ReadFre:" + id +"/" + div(txChannel, 1000000) + "/" + div(rxChannel, 1000000)+ "/" + nameChannel+ "/" + colorCode+ "/" + timeSlot+ "/" + power + "/" + channelMode;
    }

    private BigDecimal div(int v1, int v2) {
        BigDecimal b1 = new BigDecimal(Double.toString(v1));
        BigDecimal b2 = new BigDecimal(Double.toString(v2));
        return b1.divide(b2, 4, BigDecimal.ROUND_HALF_UP);
    }

}
